package com.sinodata.bsm.common.constants;

/**
 * 
 * <p>
 * Description: 通知常量定义
 * </p>
 *
 * @author liulibo
 * @version 1.0

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2012-5-24 PM 2:37:44     liulibo        1.0         To create
 * </p>
 *
 * @since 
 * @see
 */
public class NotifyConstants {

    /**
     * 平台名称（用于告诉通知中心，发送通知的平台名）
     */
    public final static String SYS_NAME = "BSM";

    /**
     * 通知类型：及时通知
     */
    public final static int TYPE_TIMELY = 1;

    /**
     * 通知类型：提升通知
     */
    public final static int TYPE_UPGRADE = 2;

    /**
     * 通知类型：恢复事件通知
     */
    public final static int TYPE_RESUME = 3;

    /**
     * 通知类型描述：及时通知
     */
    public final static String TYPE_STR_TIMELY = "及时通知";

    /**
     * 通知类型描述：提升通知
     */
    public final static String TYPE_STR_UPGRADE = "提升通知";

    /**
     * 通知类型描述：恢复通知
     */
    public final static String TYPE_STR_RESUME = "恢复通知";

    /**
     * 通知方式：短信
     */
    public final static int MODE_SMS = 1;

    /**
     * 通知方式：邮件
     */
    public final static int MODE_MAIL = 2;

    /**
     * 通知方式描述：短信
     */
    public final static String MODE_STR_SMS = "短信";

    /**
     * 通知方式描述：邮件
     */
    public final static String MODE_STR_MAIL = "邮件";

    /**
     * 通知方式描述：未知
     */
    public final static String MODE_STR_UNKNOWN = "未知";

    /**
     * 通知规则状态：禁用
     */
    public final static int RULE_STATUS_DISABLE = 0;

    /**
     * 通知规则状态：启用
     */
    public final static int RULE_STATUS_ENABLE = 1;

    /**
     * 通知规则状态描述：禁用
     */
    public final static String RULE_STATUS_STR_DISABLE = "禁用";

    /**
     * 通知规则状态描述：启用
     */
    public final static String RULE_STATUS_STR_ENABLE = "启用";

    /**
     * 通知规则 排除（已屏蔽）
     */
    public final static int RULE_EXCLUDE = 1;

    /**
     * 通知规则 未排除（未屏蔽）
     */
    public final static int RULE_INCLUDE = 0;

    /**
     * 通知规则 自身的规则（自身规则不存在排除，不排除，只有屏蔽未屏蔽）
     */
    public final static int RULE_SELF = 2;

    /**
     * 获取通知类型描述
     * 
     * @param type
     * @return
     */
    public static String getTypeDesc(int type) {
        String retString = null;
        switch (type) {
            case TYPE_TIMELY:
                retString = TYPE_STR_TIMELY;
                break;
            case TYPE_UPGRADE:
                retString = TYPE_STR_UPGRADE;
                break;
            case TYPE_RESUME:
                retString = TYPE_STR_RESUME;
                break;
            default:
                retString = MODE_STR_UNKNOWN;
        }
        return retString;
    }

    /**
     * 获取通知方式描述
     * 
     * @param mode
     * @return
     */
    public static String getModeDesc(int mode) {
        String retString = null;
        switch (mode) {
            case MODE_SMS:
                retString = MODE_STR_SMS;
                break;
            case MODE_MAIL:
                retString = MODE_STR_MAIL;
                break;
            default:
                retString = MODE_STR_UNKNOWN;
        }
        return retString;
    }

    /**
     * 获取通知规则状态描述
     * 
     * @param status
     * @return
     */
    public static String getRuleStatusDesc(int status) {
        String retString = null;
        switch (status) {
            case RULE_STATUS_DISABLE:
                retString = RULE_STATUS_STR_DISABLE;
                break;
            case RULE_STATUS_ENABLE:
                retString = RULE_STATUS_STR_ENABLE;
                break;
            default:
                retString = MODE_STR_UNKNOWN;
        }
        return retString;
    }

}